package org.rudenko.happybirthday;

import android.app.Activity;
import android.database.Cursor;
import android.os.Bundle;
import android.provider.ContactsContract;
import android.widget.CursorAdapter;
import android.widget.ListView;
import android.widget.SimpleCursorAdapter;

public class HappyBirthdayActivity extends Activity {
    /** Called when the activity is first created. */
    Cursor cur;
    CursorAdapter curAd;
    ListView list;
    
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        this.cur = this.getContentResolver().query(ContactsContract.Contacts.CONTENT_URI, 
        		null, null, null, null);
        
        this.curAd = new SimpleCursorAdapter(this, android.R.layout.two_line_list_item, this.cur, 
        		new String[] { ContactsContract.Contacts.DISPLAY_NAME,ContactsContract.Contacts.TIMES_CONTACTED}, new int[] {android.R.id.text1,android.R.id.text2});
        
        list = (ListView)findViewById(R.id.main_list);
        list.setAdapter(this.curAd);
        
        
    }
}